﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace App.Validate
{
    public class LessThanValidatorAttribute : ValidatorAttribute
    {
        public IComparable UpperBound { get; private set; }

        public LessThanValidatorAttribute(string messageTemplate, int upperBound)
            : base(messageTemplate)
        {
            this.UpperBound = upperBound;
        }

        public LessThanValidatorAttribute(string messageTemplate, double upperBound)
            : base(messageTemplate)
        {
            this.UpperBound = upperBound;
        }

        public LessThanValidatorAttribute(string messageTemplate, DateTime upperBound)
            : base(messageTemplate)
        {
            this.UpperBound = upperBound;
        }

        public override Validator CreateValidator()
        {
            return new LessThanValidator(this.MessageTemplate, this.UpperBound);
        }
    }
}
